package my.design.state;

/**
 * @author zp
 * @version 1.0
 * @description: 审核类
 * @date 2022/10/30 16:51
 */
public class CheckState extends State {
    private final ActivityService activityService;

    public CheckState(ActivityService activityService) {
        this.activityService = activityService;
    }

    @Override
    public Result arraignment(Enum<Status> currentStatus) {
        return new Result("0001", "待审核状态不可重复提审");
    }

    @Override
    public Result checkPass(Enum<Status> currentStatus) {
        activityService.getActivityInfo().setStatus(Status.Pass);
        return new Result("0000", "活动审核通过完成");
    }

    @Override
    public Result checkRefuse(Enum<Status> currentStatus) {
        activityService.getActivityInfo().setStatus(Status.Refuse);
        return new Result("0000", "活动审核拒绝完成");
    }

    @Override
    public Result checkRevoke(Enum<Status> currentStatus) {
        activityService.getActivityInfo().setStatus(Status.Editing);
        return new Result("0000", "活动审核撤销完成，回到编辑当中");
    }

    @Override
    public Result close(Enum<Status> currentStatus) {
        activityService.getActivityInfo().setStatus(Status.Close);
        return new Result("0000", "活动审核关闭成功");
    }

    @Override
    public Result open(Enum<Status> currentStatus) {
        return new Result("0001", "非关闭活动不可开启");
    }

    @Override
    public Result doing(Enum<Status> currentStatus) {
        return new Result("0001", "待审核活动不可执行活动中变更");
    }
}
